package com.longjianghuasheng.logistics.business.billing_period.fragment

import android.os.Bundle
import com.longjianghuasheng.logistics.R
import com.longjianghuasheng.logistics.base.BaseTitleFragment
import com.longjianghuasheng.logistics.business.billing_period.BillingPeriodViewModel
import com.longjianghuasheng.logistics.business.billing_period.adapter.BillingDatesAdapter
import com.longjianghuasheng.logistics.databinding.FragmentBillingDatesBinding
import com.longjianghuasheng.logistics.ext.initLinerDecoration

/**
 * 账单日期列表
 */
class BillingDatesFragment :
    BaseTitleFragment<BillingPeriodViewModel, FragmentBillingDatesBinding>() {

    private val billingDatesAdapter by lazy {
        BillingDatesAdapter()
    }

    override fun layoutId(): Int = R.layout.fragment_billing_dates

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        initTitleBar("我的账单")
        mDatabind.recyclerView.initLinerDecoration(adapter = billingDatesAdapter)

        billingDatesAdapter.setOnItemClickListener { adapter, view, position ->


            navigate(R.id.billingDetailFragment)
        }
    }

    override fun createObserver() {
        super.createObserver()
    }

    override fun initData() {
        super.initData()
    }

    override fun lazyLoadData() {
        super.lazyLoadData()
        billingDatesAdapter.setNewInstance(MutableList(5) { "" })
    }

}